﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ComUIControl
{
    public partial class MsgBox : Form
    {
        private string _msg = "";
        public MsgBox(string msg)
        {
            InitializeComponent();
            _msg = msg;
        }

        private void MsgBox_Load(object sender, EventArgs e)
        {
            lblInfo.BeginInvoke(new Action(() =>
                {

                    lblInfo.Text = _msg;
                }
             ));
            
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        public static void Show(string msg)
        {
            MsgBox box = new MsgBox(msg);
            box.ShowDialog();
        }
    }
}
